#define _CRT_SECURE_NO_WARNINGS 1
#include "Stack.h"

void STTest()
{
	ST st;
	//初始化
	StackInit(&st);
	StackPush(&st, 1);
	StackPush(&st, 2);
	StackPush(&st, 3);
	StackPush(&st, 4);
	printf("size:%d\n", StackSize(&st));
	//StackPop(&st);
	//循环出栈,直到栈为空
	while (!StackEmpty(&st))
	{
		STDataType data = StackTop(&st);
		printf("%d ", data);
		//出栈
		StackPop(&st);
		printf("\n");
	}
	printf("size:%d\n", StackSize(&st));


	//销毁
	StackDestroy(&st);
}

int main()
{
	STTest();
	return 0;
}